package com.bls.executor;

import com.bls.executor.environment.MyMQ;
import com.rabbitmq.client.*;

import java.io.IOException;
import java.util.Map;
import java.util.Set;

public class StopMq {
    public static void main(String[] args) throws Exception {

    }

    public static void stop(Map map){
        if(!map.isEmpty()){
            Set<Map.Entry<String, Channel>> entries = map.entrySet();
            for(Map.Entry<String, Channel> entry : entries){
                Channel channel = entry.getValue();
                try {
                    channel.basicCancel(entry.getKey());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
